package com.fan.shop.services;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import com.fan.shop.dao.TransactionReferenceGroupDao;
import com.fan.shop.domain.TransactionReference;
import com.fan.shop.domain.TransactionReferenceGroup;

@Named("transactionReferenceGroupService")
@Transactional(readOnly = true)
public class TransactionReferenceGroupServiceImpl implements TransactionReferenceGroupService {

	
	@Inject
	@Named("transactionReferenceGroupDao")
	private TransactionReferenceGroupDao transactionReferenceGroupDao;
	
	
	public TransactionReferenceGroupDao getTransactionReferenceGroupDao() {
		return transactionReferenceGroupDao;
	}

	public void setTransactionReferenceGroupDao(
			TransactionReferenceGroupDao transactionReferenceGroupDao) {
		this.transactionReferenceGroupDao = transactionReferenceGroupDao;
	}

	@SuppressWarnings("rawtypes")
	public List getList() {
		return transactionReferenceGroupDao.getAllTransactionReferencesGroups();
	}

	public List<String> getColumnNames() {
		return transactionReferenceGroupDao.getColumnNames();
	}

	public int getColumnsSize() {
		return transactionReferenceGroupDao.getColumnNames().size();
	}

	public List<TransactionReferenceGroup> getAllTransactionReferenceGroups() {
		return transactionReferenceGroupDao.getAllTransactionReferencesGroups();
	}

	public TransactionReferenceGroup getTransactionReferenceGroup(String name) {
		return transactionReferenceGroupDao.getTransactionReferenceGroup(name);
	}

	public boolean hasTransactionReferenceGroup(String name) {
		return transactionReferenceGroupDao.hasTransactionReferenceGroup(name);
	}

	@Transactional(readOnly = false)
	public void addTransactionReferenceGroup(
			TransactionReferenceGroup transactionReferenceGroup) {
		transactionReferenceGroupDao.addTransactionReferenceGroup(transactionReferenceGroup);
	}
	@Transactional(readOnly = false)
	public void updateTransactionReferenceGroup(
			TransactionReferenceGroup transactionReferenceGroup) {
		transactionReferenceGroupDao.updateTransactionReferenceGroup(transactionReferenceGroup);
	}
	@Transactional(readOnly = false)
	public void deleteTransactionReferenceGroup(
			TransactionReferenceGroup transactionReferenceGroup) {
		transactionReferenceGroupDao.deleteTransactionReferenceGroup(transactionReferenceGroup);
	}

	public List<TransactionReferenceGroup> getAllTransactionReferencesGroup() {
		return transactionReferenceGroupDao.getAllTransactionReferencesGroups();
	}

	public int getSize() {
		return transactionReferenceGroupDao.getSize();
	}

	public List<TransactionReference> getSubTransactionReferences(
			String groupCode) {
		
		return transactionReferenceGroupDao.getSubTransactionReferences(groupCode);
	}

	public Object copy(Object obj) {
		// TODO Auto-generated method stub
		return null;
	}

	

}
